<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<table class="form-table">
<jsp:include page="step1view.jsp"></jsp:include>
<jsp:include page="step2view.jsp"></jsp:include>


<c:if test="${empty model.ifRelateChange }">
<jsp:include page="step3view.jsp"></jsp:include>
</c:if>

</table>
<div class="header">
	<h3>跟踪</h3>
</div>
<form:form class="validate" id="problemForm"  action="problem/problem/save"  commandName="model"
	method="post">
<input name="id" type="hidden" value="${model.id }">
	<table class="form-table">
	


		<tr>
			<td class="td1">跟踪开始日期：</td>
			<td class="td2" colspan="3">
			 <input id="testbeginDate" name="testbeginDate"
				value="${model.testbeginDate }" class="required" type="datetime">

			</td>
		</tr>
				<tr>
			<td class="td1">跟踪结束日期：</td>
			<td class="td2" colspan="3">
			 <input id="testendDate" name="testendDate"
				value="${model.testendDate }" class="required" type="datetime">

			</td>
		</tr>
			<tr>
			<td class="td1">跟踪结果：</td>
			<td class="td2" colspan="3">
                 <form:radiobutton path="testResult" value="正常通过" checked="true"/>正常通过
                 <form:radiobutton path="testResult" value="故障重现" />故障重现
                 <form:radiobutton path="testResult" value="发现新故障" />发现新故障
			</td>
		</tr>
		<tr>
			<td class="td1">跟踪总结：</td>
			<td class="td2" colspan="3">
			   <textarea id="testResultthink"
					name="testResultthink" class="required2">${model.testResultthink }</textarea>
			</td>
		</tr>

	</table>
	
	</form:form>
	
<div class="header">
	<h3>关联流程</h3>
</div>
<isperp:processRelation businessKey="${model.id }" readonly="true"
	processKey="problemProcess" projectIdControl="projectIdControl" ></isperp:processRelation>



<isperp:buttonList>
	<isperp:processButtons processKey="problemProcess"  formId="problemForm"
		processId="${model.processId }" businessKey="${model.id }" beforeSubmit="function c(){return check();}"></isperp:processButtons>
</isperp:buttonList>
<script type="text/javascript">
function check()
{
  var ifRelateChange="${model.ifRelateChange}";
  var ifFinishChange="${model.ifFinishChange}";
  if(ifRelateChange=="1" && ifFinishChange=="1")
  {
     return true;
  }else if(ifRelateChange=="1")
  {
     if(confirm("此问题单关联了变更流程，确认要关闭吗？"))
     {
         return true;
     }else
     {
         return false;
     }
  }else
  {
     return true;
  }
   
}
</script>

